import VueRouter from 'vue-router';

// 导入对应的路由组件
import HomeContainer from '../components/tabbar/HomeContainer.vue';
import MemberContainer from '../components/tabbar/MemberContainer.vue';
import ShopcarContainer from '../components/tabbar/ShopcarContainer.vue';
import SearchContainer from '../components/tabbar/SearchContainer.vue';

//导入新闻new系类组件
import NewsList from '../components/news/newslist.vue';
import NewsInfo from '../components/news/newsinfo.vue';

//导入图片系列组件
import PhotoList from '../components/photos/photoslist.vue';
import PhotoInfo from '../components/photos/photoinfo.vue';

//导入商城洗系列组件
import GoodsList from '../components/goods/goodslist.vue';
import GoodsInfo from '../components/goods/goodsinfo.vue';
import GoodsPresent from '../components/goods/goodspresent.vue';
import GoodsComment from '../components/goods/goodscomment.vue';

//3.创建路由对象
var router = new VueRouter({
    routes: [// 配置路由规则的
        { path: '/', redirect: '/home' },
        { path: '/home', component: HomeContainer },
        { path: '/member', component: MemberContainer },
        { path: '/shopcar', component: ShopcarContainer },
        { path: '/search', component: SearchContainer },

        { path: '/home/NewsList', component: NewsList },
        { path: '/home/NewsInfo/:id', component: NewsInfo },

        { path: '/home/PhotoList', component: PhotoList },
        { path: '/home/PhotoInfo/:id', component: PhotoInfo },

        { path: '/home/GoodsList', component: GoodsList },
        { path: '/home/GoodsInfo/:id', component: GoodsInfo ,name:"goodsinfo"},
        { path: '/home/GoodsPresent/:id', component: GoodsPresent ,name:"goodspresent"},
        { path: '/home/GoodsComment/:id', component: GoodsComment ,name:"goodscomment"},
    ],
    linkActiveClass: 'mui-active'// 覆盖默认的路由高亮的类，默认的类叫做 router-link-active
})
export default router;